import { http } from '@/utils/http/axios';

/**
 * @description: 根据用户id获取用户菜单
 */
export function adminMenus() {
  return http.request({
    url: '/menus',
    method: 'GET',
  });
}

/**
 * 租户角色列表
 * @param params 
 * @returns 
 */
export function getMenuList(params) {
  return http.request({
    url: '/moss-cloud-base/base/sysMenu/menuTree',
    method: 'POST',
    data:params,
  });
}

/**
 * 角色菜单集合
 * @param params 
 * @returns 
 */
export function userMenuIds(params) {
  return http.request({
    url: '/moss-cloud-base/base/sysRoleMenu/roleMenuIds',
    method: 'POST',
    data:params,
  });
}

/**
 * @description: 修改菜单信息
 */
export function updateMenu(params) {
  return http.request({
    url: '/moss-cloud-base/base/sysMenu/editSysMenu',
    method: 'POST',
    data:params,
  }, {
    isTransformResponse: false,
  });
}

/**
 * 获取菜单信息
 * @param params 
 * @returns 
 */
export function menuInfo(params) {
  return http.request({
    url: '/moss-cloud-base/base/sysMenu/menuInfo',
    method: 'POST',
    data:params,
  });
}
/**
 * 添加菜单
 * @param params 
 * @returns 
 */
export function addMenu(params) {
  return http.request({
    url: '/moss-cloud-base/base/sysMenu/addSysMenu',
    method: 'POST',
    data:params,
  }, {
    isTransformResponse: false,
  });
}

/**
 * 删除菜单
 * @param params 
 * @returns 
 */
export function delSysMenu(params) {
  return http.request({
    url: '/moss-cloud-base/base/sysMenu/delSysMenu',
    method: 'POST',
    data:params,
  }, {
    isTransformResponse: false,
  });
}

/**
 * @description: 刷新资源池
 */
export function refreshSysMenu() {
  return http.request({
    url: '/moss-cloud-base/base/sysMenu/refreshSysMenu',
    method: 'POST',
    data: {},
  },{
    isTransformResponse: false,
  });
}

